package com.example.wac.constant;

import com.baidu.disconf.client.common.annotations.DisconfFile;
import com.baidu.disconf.client.common.annotations.DisconfFileItem;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author wuancheng
 * @description
 * @date 2022-01-04 14:18:00
 */

@Slf4j
@Data
@Component
@DisconfFile(filename = "system.properties")
public class DisconfConstant {
    public Integer tokenLimitTime;

    public String secret;

    public Integer emailLimitTime;

    public Integer emailSendCount;

    @DisconfFileItem(name = "email.time.range.limit" , associateField = "emailLimitTime")
    public void setEmailLimitTime(Integer emailLimitTime) {
        this.emailLimitTime = emailLimitTime;
    }

    @DisconfFileItem(name = "email_send.count" , associateField = "emailSendCount")
    public void setEmailSendCount(Integer emailSendCount) {
        this.emailSendCount = emailSendCount;
    }

    @DisconfFileItem(name = "token.secret" , associateField = "secret")
    public void setSecret(String secret) {
        this.secret = secret;
    }

    @DisconfFileItem(name = "token.expire.time" , associateField = "tokenLimitTime")
    public void setTokenLimitTime(Integer tokenLimitTime) {
        this.tokenLimitTime = tokenLimitTime;
    }

    public Integer getEmailLimitTime() {
        return emailLimitTime;
    }

    public Integer getTokenLimitTime() {
        return tokenLimitTime;
    }

    public String getSecret() {
        return secret;
    }

    public Integer getEmailSendCount() {
        return emailSendCount;
    }
}
